package com.atguigu01._static.apply;

public class CircleTest {
    public static void main(String[] args) {
        Circle c1=new Circle();
        System.out.println(c1.toString());
        System.out.println(Circle.total);
        Circle c2=new Circle();
        System.out.println(c2.toString());
        System.out.println(Circle.total);
    }
}

class Circle{
    private double r;
    private int id;
    static int total=0;
    static int init=1001;

    public Circle() {
        id=init;
        init++;
        total++;
    }

    @Override
    public String toString() {
        return "Circle{" +
                "r=" + r +
                ", id=" + id +
                '}';
    }
}
